Public: Technology Reviews : Installing Git with macports
This page last changed on May 18, 2009 by scytacki.
Installing git with macports1 Install an up-to-date Apple Developer ToolsInstall an up-to-date Apple Developer Tools if you don't have it already installed. A copy of the Apple Developer Tools available at the time your computer was manufactured is available on a second DVD that came with the copy of the original OS. You can download an up-to-date Apple Developer Tools by registering for a free account Apple Developer Connection account here: http://connect.apple.com. The download is about 1GB. Apple Developer Tools installs the gcc toolchain which is needed for compiling any new native C or C++, libraries. 1.1 Install MacPortsInstallation instructions for MacPorts are here: http://www.macports.org/install.php After installing MacPorts the path /opt/local/bin/port should exist. Running the command which port in a shell should produce this response: $ which port /opt/local/bin/port Add /opt/local/bin to your PATH environment variable if it does not already contain this path. If you use bash you can add /opt/local/bin to the end of your PATH environmental variable in your ~/.profile or ~/.bash_profile file with a statement like his: export PATH=$PATH:/opt/local/bin Install git using Macports# # Git setup and configuration on Mac # adapted from: http://arthurkoziel.com/2008/05/02/git-configuration/ # # first install macports if you don't have it installed # # http://guide.macports.org/#installing.macports # make sure your local ports tree is up-to-date sudo port selfupdate # find out what version of git is available port search git-core # list the port variants available for git port variants git-core # install git and add the variants git-svn and git bash completion scripts sudo port install git-core +svn+bash_completion # you can add "+doc+gitweb" to get the html form of the documentation # and the web application that will serve git # Install bash completion: cp /opt/local/etc/bash_completion.d/git ~/.git-bash-completion.sh echo "[ -f ~/.git-bash-completion.sh ] && . ~/.git-bash-completion.sh" >> ~/.profile . ~/.profile # If you've already installed git using ports and want to know if there # is a newer version of git available sudo port selfupdate port outdated git-core # Installing a newer version of git # The old version is de-activated but will stay installed so it is # easy to deactivate the newer version and activate the older version # if that proves necessary. sudo update git-core +svn+bash_completion # Git configuration # List of configuration variables: git config --help # list your current global git config properties git config --global -l # Global ignore file: echo ".DS_Store" >> ~/.gitignore git config --global core.excludesfile ~/.gitignore # SVN-like shortcuts for often used commands: git config --global alias.st status git config --global alias.ci commit git config --global alias.co checkout git config --global alias.br branch # Information about the author/commiter: git config --global user.name "Your Name Comes Here" git config --global user.email you@yourdomain.example.com # If you want git to send patches via mail from git: git config --global sendemail.smtpserver smtp.my-isp.com # Colorized output: git config --global color.branch auto git config --global color.diff auto git config --global color.interactive auto git config --global color.status auto # TextMate as the default editor: git config --global core.editor "mate -w" # Opendiff (FileMerge) to resolve merge conflicts: git config --global merge.tool opendiff # Change the font in gitk: # Open ~/.gitk and add: set mainfont {Monaco 12} set textfont {Monaco 12} set uifont {Monaco 12}
|
Document generated by Confluence on Jan 27, 2014 16:56 |